#include <iostream>
#include "xbench/benchmark.hpp"

using namespace std;

int test3(int n){
    int result = 0;
    for(int i = 0; i < n; i++){
        result += i;
    }
    return result;
}

void test2(int n){
    test3(n);
}

void test1(){
    test3(10000);
}

int test4(int a, int b){
    return a + b;
}

int main(){
    auto& state = xbench::Benchmark::get_state("test1");

    state | test1;
    state.measure(test2, 10000);
    state.measure(test3, 10000);

    XBENCH("test2", test1);
    XBENCH("test2", test2, 100000);
    XBENCH("test2", test4, 100000, 100000);

    cout << xbench::Benchmark() << endl;

    return 0;
}